<template>
  <div style="padding: 20px;">
    <page-table ref="pageTableRef" :tabs="tabs" :columns="columns" :searchInitParam="searchParam">
    </page-table>
  </div>
</template>

<script lang="jsx" setup name="company">
import { getStudentList } from '@/api/page'

const tabs = ref({
  key: 'type',
  value: 'ORDER_MODULE',
  list: [
    {
      name: 'ORDER_MODULE',
      label: '订单管理',
      listApi: getStudentList
    },
    {
      name: 'USER_MODULE',
      label: '日志管理',
      listApi: getStudentList
    }
  ]
})
const buyStatusOptions = [
  { label: '全部', value: 'all' },
  { label: '已落地', value: '1' }
]

const searchParam = reactive({
  keyword: ''
})

const columns = computed(() => [
  {
    label: '时间',
    prop: 'name',
    width: 130,
    align: 'center'
  },
  {
    label: '平台',
    prop: 'idCard',
    width: 130,
    align: 'center'
  },
  {
    label: '代币信息',
    prop: 'major',
    width: 130,
    align: 'center'
  },
  {
    label: '被跟地址',
    prop: 'major',
    width: 130,
    align: 'center'
  },
  {
    label: '被跟TX',
    prop: 'major',
    width: 130,
    align: 'center'
  },
  {
    label: '金额(SQL)',
    prop: 'major',
    width: 130,
    align: 'center'
  },
  {
    label: '市值(SQL)',
    prop: 'major',
    width: 130,
    align: 'center'
  },
  {
    label: '未跟单原因',
    prop: 'major',
    minWidth: 170,
    align: 'center'
  },
  {
    label: '买入状态',
    hidden: true,
    options: buyStatusOptions,
    search: { el: 'select', key: 'buyStatus', props: { clearable: true } }
  },
  {
    label: '钱包备注',
    hidden: true,
    search: { el: 'input', props: { clearable: true } }
  }
])

const detailDialogRef = ref(null)
const checkStudentDetail = (type, row) => {
  detailDialogRef.value?.openDialog(type, row)
}

// 刷新列表
const pageTableRef = ref(null)
const handleRefresh = () => {
  pageTableRef.value?.handleRefresh()
}
</script>
